package com.dzy.boot.lock;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = DLockProperties.PREFIX)
public class DLockProperties {

    public static final String PREFIX = "spring.redis";
    //redisson
    private String host = "150.109.42.197";
    private String password = "52leifeng@";
    private int port = 6379;
    private int database = 15;
    //cluster.nodes
    private Cluster cluster;
    private String codec = "org.redisson.codec.JsonJacksonCodec";
    //lock
    private long waitTime = 60;
    private long leaseTime = 60;

    public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getCodec() {
        return codec;
    }

    public void setCodec(String codec) {
        this.codec = codec;
    }

    public long getWaitTime() {
        return waitTime;
    }

    public void setWaitTime(long waitTime) {
        this.waitTime = waitTime;
    }

    public long getLeaseTime() {
        return leaseTime;
    }

    public void setLeaseTime(long leaseTime) {
        this.leaseTime = leaseTime;
    }

    public int getDatabase() {
        return database;
    }

    public void setDatabase(int database) {
        this.database = database;
    }

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}


    public Cluster getCluster() {
		return cluster;
	}

	public void setCluster(Cluster cluster) {
		this.cluster = cluster;
	}


	public static class Cluster{

        private String[] nodes;

		public String[] getNodes() {
			return nodes;
		}

		public void setNodes(String[] nodes) {
			this.nodes = nodes;
		}

    }
}
